#include <iostream>
#include <unistd.h>
#include <signal.h>

void handler(int signal) {
    std::cout << "signal: " << signal << std::endl; 
    exit(0);
}

int main() {
    for (int i = 1; i <= 64; i ++)
        signal(i, SIG_IGN);
    
    signal(2, handler);
    while (1) {
        std::cout << "exec once" << std::endl;
        sleep(1);
    }
}